```python
import logging
import os
import sys
from collections.abc import MutableMapping
from typing import Any
import asyncio
import threading
from utils import request_id # type: ignore
class CustomAdapter(logging.LoggerAdapter):
"""This adapter adds request ID and execution context (thread/task info) to the log message."""
def process(
self, msg: str, kwargs: MutableMapping[str, Any]
) -> tuple[str, MutableMapping[str, Any]]:
thread_name = threading.current_th
```python
import logging
import os
import sys
from collections.abc import MutableMapping
from typing import Any
import asyncio
import threading
from utils import request_id # type: ignore
class CustomAdapter(logging.LoggerAdapter):
"""This adapter adds request ID and execution context (thread/task info) to the log message."""
def process(
self, msg: str, kwargs: MutableMapping[str, Any]
) -> tuple[str, MutableMapping[str, Any]]:
thread_name = threading.current_th
export default function Order () {
return();
};
the same is
const Order = () => {
return();
};
export default Order;
but the first one helps with debigging.
the function name will show up in a stack trace
function Get-WUVersionInfo {
$DISMDetails = & "${env:windir}\system32\dism.exe" /Online /Get-Packages /Format:Table | ? {$_.Contains("|") -and -not $_.StartsWith("-")} | % {($_.Split('|').Trim() -join ',')} | ConvertFrom-Csv
$DISMDetails | Where-Object 'Package Identity' -match '^Package_for_(RollupFix|ServicingStack)' | ForEach-Object {
$Package = $_
$PackageName = $Package.'Package Identity'.Split('~')[0]
$InstalledOn = $Package.'Install Time'
swit
/**
* @param {number[]} nums
* @return {number[]}
*/
var smallestSubarrays = function(nums) {
const n = nums.length;
const answer = new Array(n).fill(1); // Result array
const latestSeenBit = new Array(32).fill(-1); // Tracks last index each bit is seen
for (let i = n - 1; i >= 0; i--) {
// Update latestSeenBit with bits from nums[i]
for (let b = 0; b < 32; b++) {
if ((nums[i] & (1 << b)) !== 0) {
latestSeenBit[b] = i;
# CORS (Cross-Origin Resource Sharing) is a security feature implemented by web browsers that prevents web pages from making requests to
a different domain, protocol, or port than the one serving the web page.
This is a security measure to protect users from malicious websites.
The Problem:
When developing a React application (like yours), you typically have:
Frontend: Running on http://localhost:5173 (Vite's default dev server)
Backend API: Running on a different port, like http://localhost:
const newParams = new URLSearchParams({ orientation: "landscape", width: "1600", height: "2560" });
window.history.pushState({}, "", "?" + newParams.toString());
## React reference
# Complete Setup Sequence
1. npm create vite@latest . --template react # Creates React app with Vite (includes vite + react plugin)
2. npm install --save-dev prettier # Add Prettier
3. npm install --save-dev eslint@^9.32.0 eslint-plugin-react@^7.34.0 # Add ESLint
4. Add config files (.prettierrc, eslint.config.mjs)
5. Add scripts to package.json
6. Add to existing .gitignore(look below)
7. npm run dev # Start development serv
$smtpFromAddress = ""
$smtpToAddresses = @(
''
)
$ReportName = "App Portal - Computer Name Detection Method Report"
function Get-FlexeraAppPortalNameResolution {
[CmdletBinding()]
param(
[System.IO.FileInfo[]]$Path
,
[string]$ClientIP
)
function ConvertFrom-IISLog {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
<base-swiper
id="collection-swiper--{{ section.id }}"
class="{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"
data-config='{
"slidesPerView": {{ section.settings.columns_desktop }},
"autoplay": {{ section.settings.enable_autoplay }},
"loop": {{ section.settings.enable_loop }},
"spaceBetween": 20,
"speed": 600,
"centerInsufficientSlides": true,
"delay": {{ section.settings
{% comment %}
--------------------------------------------------------------------------------------------------------------
SUPPORTED PARAMETERS
--------------------------------------------------------------------------------------------------------------
* product *required
* current_variant
{% endcomment %}
{%- if product != blank -%}
{%- liquid
unless current_variant
assign current_variant = product.selected_or_first_available_variant
endunless
assign product
sudo ip route add default via 192.168.254.9
{% assign allPosts = Module.FieldValues.BlogSource.Entries %}
{% assign maxPosts = Module.FieldValues.MaxRelated %}
{% assign blogLink = SitePage.Slug %}
<div class="pp-related-content-widget hidden">
<h3>Related Content</h3>
<ul class="related-posts-list"></ul>
</div>
<script>
const allPosts = {{ allPosts | json:false }};
// const currentPost = Entry | json:false ;
console.log('all posts', allPosts);
function getRelatedPosts(current, posts, postTags, count = {{max
Basic Syntax and Constructor
const observer = new IntersectionObserver(callback, options);
The constructor takes two parameters:
- **callback**: A function executed whenever the observed element's intersection changes
- **options**: An optional object to customize the observer's behavior
Callback Function
The callback receives two parameters:
function callback(entries, observer) {
entries.forEach(entry => {
// Process each intersection change
});
}
Int
server {
server_name newjourney.online;
root /mnt/storage2/alpha;
index index.php index.html index.htm;
client_max_body_size 150M;
add_header X-Server-Name "alpha";
location ~ ^/(ru|en)/(.+\.(?:jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot|webp|mp4))$ {
try_files /$2 =404;
}
location ~* ^/(assets|core|connectors|manager|rest|\.well-known) {
try_files $uri $uri/ @php;
}
location / {
try_files $uri $uri/index